#include "widget.h"
#include "ui_widget.h"
#include<QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    this->setWindowTitle("MAN!!!");
    qDebug()<<"WindowTitle: "<<this->windowTitle();
    qDebug()<<"Geometry: "<<this->geometry();
    qDebug()<<"frameGeometry: "<<this->frameGeometry();

    //ui->pushButton->move(0,0);
    qDebug()<<this->x()<<this->y();


}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
    QRect rect1 = this->geometry();
    QRect rect2 = this->frameGeometry();
    //x,y都是基于屏幕左上角；frameGeometry会包括一部分阴影
    qDebug() << rect1;
    qDebug() << rect2;
    qDebug()<<this->x()<<this->y();

    qDebug()<<ui->pushButton->geometry();
    qDebug()<<ui->pushButton->frameGeometry();
}

